package com.sxt;

import javax.sound.sampled.*;
import java.applet.Applet;
import java.applet.AudioClip;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;

public class GameMusic {
    public static AudioClip bullet;
    public static AudioClip button;
    public static AudioClip enemy1_down;
    public static AudioClip enemy2_down;
    public static AudioClip enemy3_down;
    public static AudioClip enemy3_flying;
    public static AudioClip game_music;
    public static AudioClip get_bomb;
    public static AudioClip get_bullet;
    public static AudioClip me_down;
    public static AudioClip supply;
    public static AudioClip upgrade;
    public static AudioClip use_bomb;
    static
    {
        try{
            bullet= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\bullet.wav").toURI().toURL());
            button= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\button.wav").toURI().toURL());
            enemy1_down= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\enemy1_down.wav").toURI().toURL());
            enemy2_down= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\enemy2_down.wav").toURI().toURL());
            enemy3_down= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\enemy3_down.wav").toURI().toURL());
            enemy3_flying= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\enemy3_flying.wav").toURI().toURL());
            game_music= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\game_music.wav").toURI().toURL());
            get_bomb= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\get_bomb.wav").toURI().toURL());
            get_bullet= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\get_bullet.wav").toURI().toURL());
            me_down= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\me_down.wav").toURI().toURL());
            supply= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\supply.wav").toURI().toURL());
            upgrade= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\upgrade.wav").toURI().toURL());
            use_bomb= Applet.newAudioClip(new File("D:\\ComputerLearning\\TYUT_Computer\\AircraftWar_\\sound\\use_bomb.wav").toURI().toURL());
        }catch(MalformedURLException e){
            System.out.println("音乐播放出错1。");
        }
    }

}
